package tests;

public class test25 {
    //左右最值最大差
    public class MaxGap{
        public int findMaxGap(int[] A, int n){
            int m = A[0];
            for(int i = 1;i < n;i++){
                m = Math.max(m,A[i]);
            }
            return m - Math.min(A[0],A[n - 1]);
        }
    }
}
